<B:UIEKP x:Class="WPFExcelReport.TTSTEKP"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"     
                    xmlns:me="clr-namespace:WPFExcelReport" 
                    xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls"
                    xmlns:Localization="clr-namespace:Localization;assembly=Localization" 
                    xmlns:VF="clr-namespace:WPFExcelReport;assembly=TVAFARBEN"  
                    xmlns:T="clr-namespace:WPFExcelReport;assembly=IntexBL" 
                    xmlns:ZB="clr-namespace:WPFExcelReport;assembly=TVKZUAB"  
                    xmlns:SD="clr-namespace:WPFExcelReport;assembly=TSDDAT"  
                    xmlns:WS="clr-namespace:WPFExcelReport;assembly=TWASTAMM"  
                    xmlns:WF="clr-namespace:WPFExcelReport;assembly=TWAFARBEN"  
                    xmlns:MU="clr-namespace:WPFExcelReport;assembly=TABAUFM"  
                    xmlns:TXT="clr-namespace:WPFExcelReport;assembly=TTXTIND" 
           xmlns:B="clr-namespace:WPFExcelReport;assembly=TEKPOS" 
                    FontSize="14"
                    x:Name="TV"
                    Loaded="Window_Loaded"
     >
    <B:UIEKP.Resources>
        <CollectionViewSource   x:Key="vwMaster" />
        <ucd:BoolToVisibilityConverter  x:Key="bv"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:NOTConverter  x:Key="not"/>
        <ucd:TextTrimmingConverter  x:Key="trim"/>
        <ucd:PreisConverter  x:Key="price"/>
        <ucd:PNumConverter x:Key="pnum"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <ucd:BYTE2TR x:Key="b2s"/>
        <ucd:Divideby10000 x:Key="dw"/>
    </B:UIEKP.Resources>

    <Grid  >
        <Grid.RowDefinitions>
            <RowDefinition   Height="Auto" />
            <RowDefinition   Height="1*" />
            <RowDefinition   Height="Auto" />
        </Grid.RowDefinitions>

        <StackPanel Grid.Row="0" Margin="0,0,0,0" IsEnabled="{Binding IsInactive,ElementName=TV,Converter={StaticResource not}}" >
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"></RowDefinition>
                    <RowDefinition Height="Auto"></RowDefinition>
                    <RowDefinition Height="Auto"></RowDefinition>
                    <RowDefinition Height="Auto"></RowDefinition>
                    <RowDefinition Height="Auto"></RowDefinition>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="1*"></ColumnDefinition>
                </Grid.ColumnDefinitions>
            </Grid>
            <TextBlock Grid.Row ="0"  Grid.Column="0"  Grid.ColumnSpan="2" Background="#CC119EDA" Text="{Binding Source={Localization:Translate Word=采购单行信息}}"/>
            <WrapPanel Grid.Row ="1" Grid.Column="0"   VerticalAlignment="Top">
                <Grid  Margin="5,0,0,0" VerticalAlignment="Top" IsEnabled="{Binding IsCanNew,ElementName=TV}" >
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <Button Grid.Column="0" Height="20"  Width="24" Margin="5,0,0,0"   Click="NewCommand">
                        <Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/Add.png" />
                        </Button.Background>
                    </Button>
                </Grid>
                <Grid Margin="10,0,0,0" VerticalAlignment="Top" IsEnabled="{Binding IsCanDelete,ElementName=TV}" >
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <Button Click="DeleteCommand" Height="20" Margin="5,0,0,0" Width="24" >
                        <Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/Remove.png" />
                        </Button.Background>
                    </Button>
                </Grid>
                <Grid Margin="10,0,0,0" VerticalAlignment="Top" IsEnabled="{Binding IsCanCopy,ElementName=TV}"  >
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <Button    Click="CopyCommand" Height="20" Margin="5,0,0,0" Width="24" >
                        <Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/copy.png" />
                        </Button.Background>
                    </Button>
                </Grid>
                <Grid Margin="10,0,0,0" VerticalAlignment="Top" IsEnabled="{Binding IsCanInactive,ElementName=TV}" >
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <Button Click="InactiveCommand" Height="20" Margin="5,0,0,0" Width="24" >
                        <Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/split.png" />
                        </Button.Background>
                    </Button>
                </Grid>
                <Button Content="{Binding Source={Localization:Translate Word=查看供应商发货单}}" Margin="20,0,0,0"  Click="EKWB"/>
                <Grid Margin="20,0,0,0" >
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock Grid.Column="0" FontSize="16" Text="{Binding Source={Localization:Translate Word=实收数量：}}"/>
                    <TextBlock Grid.Column="1" FontSize="16" Text="{Binding EKPME3,Converter={StaticResource d100}}" Width="80"/>
                </Grid>
                <Grid Margin="20,0,0,0" >
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock Grid.Column="0" FontSize="16" Text="{Binding Source={Localization:Translate Word=待收货数量:}}"/>
                    <TextBlock Grid.Column="1" FontSize="16" Text="{Binding EKPDIFF,Converter={StaticResource d100}}" Width="80"/>
                </Grid >
                <CheckBox Grid.Column="1" Margin="20,0,0,0"  Visibility="Collapsed"
                          IsChecked="{Binding IsShowEKGB,ElementName=TV}"  
                              Content="{Binding Source={Localization:Translate Word=查看}}"
                          VerticalAlignment="Top"/>
            </WrapPanel>
            <WrapPanel  Margin="0,0,0,0" VerticalAlignment="Top">
                <TextBlock Grid.Column="0" FontSize="16" Text="{Binding Source={Localization:Translate Word=品种:}}"/>
                <VF:TLSVA11 Name="cVA10"
                           LIEFNR="{Binding LIEFNR,ElementName=TV}"
                           ORDERNUM="{Binding KEY,ElementName=lsVA09}"   
                           IsEdit="{Binding IsEdit,ElementName=TV}"                       
                           ARTST="{Binding ARTST,ElementName=TV}"  
                           dwVF="{Binding dwVF,ElementName=TV}" 
                           Width="Auto" />
                <VF:TLSVA09   Name="lsVA09"
                     dwVF="{Binding dwVF,ElementName=TV}" 
                    LSART="{Binding KEY,ElementName=cWS06}"/>
                <TextBlock Grid.Column="0" Text="{Binding Source={Localization:Translate Word=采购品种}}" Visibility="Collapsed"/>
                <WF:TSWS06  Name="cWS06" Visibility="Collapsed"
                    LIEFNR="{Binding LIEFNR,ElementName=TV}"
                    dwWS="{Binding dwWS,ElementName=TV}" 
                    IsEdit="{Binding IsEdit,ElementName=TV}"  />
                <WrapPanel >
                    <Grid Margin="0,0,0,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Column="0" FontSize="16"  Text="{Binding Source={Localization:Translate Word=单位:}}"/>
                        <SD:TSSD0181 Grid.Column="1" FontSize="16"
                                     KEY="{Binding MEEH,ElementName=TV}" 
                                     ORDERNUM="{Binding MEEH,ElementName=TV}" 
                                     dwKEY="{Binding dwMEEH,ElementName=TV}" 
                                     IsEdit="{Binding IsEdit,ElementName=TV}" />
                    </Grid>
                    <Grid >
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Column="0"  FontSize="16"  Text="{Binding Source={Localization:Translate Word=单价:}}"/>
                        <ex:NumericBox Grid.Column="1" FontSize="18" 
                        Name="txtPrice"
                        DecimalPlaces="2"
                        Text="{Binding EKPPRME,Converter={StaticResource price}}"  
                        IsReadOnly="{Binding IsEdit,Converter={StaticResource not}}"  
                        Width="80"/>
                    </Grid>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Column="0"  FontSize="16" Text="{Binding Source={Localization:Translate Word=数量:}}"/>
                        <ex:NumericBox Name="txtQty" Grid.Column="1" FontSize="18" DecimalPlaces="2"
                                       KeyUp="QTY_KeyUp" 
                                       Text="{Binding EKPME1,Converter={StaticResource d100}}"
                                       IsReadOnly="{Binding IsEdit,Converter={StaticResource not}}"   Width="80"/>

                    </Grid>

                    <WrapPanel>
                        <TextBlock FontSize="16" Text="{Binding Source={Localization:Translate Word=金额:}}"/>
                        <TextBlock FontSize="16" Text="{Binding EKPWE1}" Width="80"/>
                        <TextBlock FontSize="16" Text="{Binding Source={Localization:Translate Word=交易价值:}}"/>
                        <TextBlock FontSize="16" Text="{Binding BUVALUE,Source={StaticResource vwMaster}}" Width="80"/>
                        <TextBlock Visibility="Collapsed" Text="{Binding Source={Localization:Translate Word=汇率:}}"/>
                        <TextBlock Visibility="Collapsed" Text="{Binding EKPKURS,Converter={StaticResource dw}}" Width="80"/>
                    </WrapPanel>

                    <Grid Margin="10,0,0,0" VerticalAlignment="Top" Visibility="Collapsed">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock   Grid.Column="0" Text="{Binding Source={Localization:Translate Word=附加费:}}"></TextBlock>
                        <CheckBox Grid.Column="1" IsChecked="{Binding IsShowBottom,ElementName=TV,Mode=OneWayToSource}"  
                          VerticalAlignment="Top"></CheckBox>
                    </Grid>
                </WrapPanel>
            </WrapPanel>
            <WrapPanel>
                <WrapPanel>
                    <TextBlock Grid.Column="0"   Text="{Binding Source={Localization:Translate Word=交期:}}"/>
                    <ex:NumericBox Grid.Column="1" FontSize="18"    
                                       Text="{Binding EKPLTERM}" 
                                   IsReadOnly="{Binding IsEdit,Converter={StaticResource not}}"   Width="120"/>
                    <Button  Grid.Column="0"   Click="DT2ALLCommand" Width="24" Height="20"  >
                        <Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/arrow-down.png" />
                        </Button.Background>
                    </Button>
                </WrapPanel>
                <WrapPanel>
                    <TextBlock Grid.Column="0"    Text="{Binding Source={Localization:Translate Word=船样:}}"/>
                    <ex:NumericBox Grid.Column="1" FontSize="18"    
                                   Text="{Binding EKPGENDAT1}" 
                                   IsReadOnly="{Binding IsEdit,Converter={StaticResource not}}"   
                                   Width="120"/>
                    <Button  Grid.Column="0"   Click="SP2ALLCommand" Width="24" Height="20"  >
                        <Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/arrow-down.png" />
                        </Button.Background>
                    </Button>
                    <TextBlock Grid.Column="2"  Text="{Binding Source={Localization:Translate Word=确认:}}"/>
                    <ex:TXT72 Grid.Column="3" Text="{Binding EKPWUTERM}"  
                              IsReadOnly="{Binding IsEdit,Converter={StaticResource not}}"
                              Width="120"/>
                    <Button  Grid.Column="0"   Click="WU2ALLCommand" Width="24" Height="20"  >
                        <Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/arrow-down.png" />
                        </Button.Background>
                    </Button>
                </WrapPanel>
                <Grid >
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock Grid.Column="0"  Text="{Binding Source={Localization:Translate Word=短/溢:}}"/>
                    <ex:TXT72 MaxLength="14" Grid.Column="1" FontSize="18" 
                             Text="{Binding EKPTEXTKON,Converter={StaticResource gb2312}}" 
                             IsReadOnly="{Binding IsEdit,Converter={StaticResource not}}"   Width="120"/>
                </Grid>

            </WrapPanel>

        </StackPanel>
        <Grid Grid.Row="1"  Grid.Column="0"  >
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="1*"></ColumnDefinition>
                <ColumnDefinition Width="300"></ColumnDefinition>
            </Grid.ColumnDefinitions>
            <DataGrid  Grid.Column="0"
                  AutoGenerateColumns="False"  EnableRowVirtualization="False"  
                  Name="dlgMaster"  IsReadOnly="True"  
                  ItemsSource="{Binding Source={StaticResource vwMaster }}" 
                  HeadersVisibility="Column"  CanUserReorderColumns="True"
                  CanUserResizeRows="True"   
                  RowDetailsVisibilityMode="VisibleWhenSelected"   
                  EnableColumnVirtualization="True" 
                  HorizontalScrollBarVisibility="Auto" 
                  VerticalScrollBarVisibility="Auto">
                <DataGrid.Columns>
                    <DataGridTextColumn Binding="{Binding Path=EKPSA}" Header="{Binding Source={Localization:Translate Word=状态}}" Width="Auto"  />
                    <DataGridTextColumn Binding="{Binding Path=EKPAUFPOS,Converter={StaticResource ResourceKey=pnum}}" Header="{Binding Source={Localization:Translate Word=行号}}" Width="Auto"  />
                    <DataGridTextColumn Binding="{Binding Path=PART}" Header="{Binding Source={Localization:Translate Word=面料}}" Width="Auto" MinWidth="30" />
                    <DataGridTextColumn Binding="{Binding Path=PFARBE}" Header="{Binding Source={Localization:Translate Word=色号}}" Width="Auto"   />
                    <DataGridTextColumn Binding="{Binding Path=EKPME1,Converter={StaticResource d100}}" Header="{Binding Source={Localization:Translate Word=数量}}" Width="Auto" MinWidth="30" />
                    <DataGridTextColumn Binding="{Binding Path=EKPME3,Converter={StaticResource d100}}" Header="{Binding Source={Localization:Translate Word=实收}}" Width="Auto" MinWidth="30" />
                    <DataGridTextColumn Binding="{Binding Path=EKPTEXTKON,Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=短/溢}}" Width="60" MinWidth="30" />
                    <DataGridTextColumn Binding="{Binding Path=EKPPRME,Converter={StaticResource d1000}}" Header="{Binding Source={Localization:Translate Word=价格}}" Width="Auto" MinWidth="30" />
                    <DataGridTextColumn Binding="{Binding Path=EKPMEEH}" Header="{Binding Source={Localization:Translate Word=单位}}" Visibility="Collapsed"  Width="Auto" MinWidth="30" />
                    <DataGridTextColumn Binding="{Binding Path=EKPWE1}" Header="{Binding Source={Localization:Translate Word=金额}}" Width="Auto" MinWidth="30" />
                    <DataGridTextColumn Binding="{Binding Path=BUVALUE}" Header="{Binding Source={Localization:Translate Word=交易价值}}" Width="Auto" MinWidth="30" />
                    <DataGridTextColumn Binding="{Binding Path=EKPMEEH}" Header="{Binding Source={Localization:Translate Word=单位}}" Width="Auto" MinWidth="30" />
                    <DataGridTextColumn Binding="{Binding Path=EKPLTERM}" Header="{Binding Source={Localization:Translate Word=交期}}" Width="80" MinWidth="30" />
                    <DataGridTextColumn Binding="{Binding Path=EKPGENDAT1}" Header="{Binding Source={Localization:Translate Word=船样}}" Width="80" MinWidth="30" />
                    <DataGridTextColumn Binding="{Binding Path=EKPWUTERM}" Header="{Binding Source={Localization:Translate Word=确认}}" Width="80" MinWidth="30" />
                    <DataGridTextColumn Binding="{Binding Path=EKPSACHB}" Header="{Binding Source={Localization:Translate Word=负责人}}" Width="Auto" MinWidth="30" />
                </DataGrid.Columns>
            </DataGrid>
            <Grid Grid.Column="1">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"></RowDefinition>
                    <RowDefinition Height="Auto"></RowDefinition>
                    <RowDefinition Height="1*"></RowDefinition>
                </Grid.RowDefinitions>
                <Grid Grid.Row="0">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"></RowDefinition>
                        <RowDefinition Height="Auto"></RowDefinition>
                    </Grid.RowDefinitions>
                    <TextBlock Grid.Row="0" Text="{Binding Source={Localization:Translate Word=关联销售单}}"/>
                    <MU:TMUVK Grid.Row="1" ORDERNUM="{Binding AUF,ElementName=TV}"/>
                </Grid>
                <Grid Grid.Row="1" >
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"></RowDefinition>
                        <RowDefinition Height="Auto"></RowDefinition>
                    </Grid.RowDefinitions>
                    <TextBlock Grid.Row ="0" Background="#CC119EDA" Text="{Binding Source={Localization:Translate Word=备注信息}}"/>
                    <TXT:TXTITX Grid.Row="1" VerticalAlignment="Bottom" 
                                 TART="EKP"
                           SIND="{Binding TXTISIND,ElementName=TV}"   
                           DEFTXT="{Binding DEFTXT,ElementName=TV}" 
                           Height="150" Width="Auto" HorizontalAlignment="Left"/>
                </Grid>
                <ex:AniScrollViewer Grid.Row="2" >
                    <WS:TWASTAMM Name="cWS" 
                                  IsImage="False"
                                   dwWS="{Binding dwWS,ElementName=TV}"   
                                  ORDERNUM="{Binding EXARTICLE,ElementName=TV}"   
                                  Width="Auto" MinWidth="300" />
                </ex:AniScrollViewer>


            </Grid>
        </Grid>
        <WrapPanel Grid.Row="2" Grid.Column="1" IsEnabled="{Binding IsInactive,ElementName=TV,Converter={StaticResource not}}">
            <WrapPanel >
                <TextBlock Text="{Binding TKEY1}"  Margin="10,0,0,0"></TextBlock>
                <TextBlock Text="{Binding SUM1,Converter={StaticResource d100}}" Foreground="Red" Margin="10,0,0,0"></TextBlock>
                <TextBlock Text="{Binding TKEY2}"   Margin="10,0,0,0"></TextBlock>
                <TextBlock Text="{Binding SUM2}" Foreground="Red" Margin="10,0,0,0"></TextBlock>
                <TextBlock Text="{Binding TKEY3}"   Margin="10,0,0,0"></TextBlock>
                <TextBlock Text="{Binding SUM3}" Foreground="Red" Margin="10,0,0,0"></TextBlock>
                <TextBlock Text="{Binding TCOUNT1}"   Margin="10,0,0,0"></TextBlock>
                <TextBlock Text="{Binding Counts}" Foreground="Red" Margin="20,0,0,0"></TextBlock>
            </WrapPanel>
            <TextBlock  Text="{Binding Source={Localization:Translate Word=更改}}"/>
            <TextBlock  Text="{Binding EKPAENB}"    Width="Auto"/>
            <TextBlock  Text="{Binding EKPAEND}"    Width="Auto"/>
            <TextBlock  Text="{Binding Source={Localization:Translate Word=创建}}"/>
            <TextBlock  Text="{Binding EKPNEUB}"    Width="Auto"/>
            <TextBlock  Text="{Binding EKPNEUD}"    Width="Auto"/>
        </WrapPanel>
    </Grid>
</B:UIEKP>
